#include <iostream>
#include <string>
using namespace std;

class Solution
{
public:
    string addBinary(string a, string b)
    {
        string res;
        int carry = 0;
        int maxLen = max(a.size(), b.size());
        for (int i = 0; i < maxLen; i++)
        {
            int valA = i < a.size() ? a[a.size() - i - 1] - '0' : 0;
            int valB = i < b.size() ? b[b.size() - i - 1] - '0' : 0;
            int val = valA + valB + carry;
            res.push_back(val % 2 + '0');
            carry = val / 2;
        }
        if (carry)
            res.push_back('1');
        reverse(res.begin(), res.end());
        return res;
    }
};

int main()
{
    cout << "Code67" << endl;
    Solution s;
    string a = "11", b = "1";
    cout << s.addBinary(a, b) << endl;
    return 0;
}